*** Settings ***
Resource          ../../../../OpElements/OpElements.robot
Resource          ../../../../../CommonVars/Locations/SITSYS/MoudleView/LRelationPartView/LInsureRelationPartView/LInsureRelationPartView.robot
Resource          ../../../../../CommonVars/DataVariables/VRelationParts/VInsureRelationPart/VInsureRelationPart.robot
Library           ../../../../../CommonLibs/FDataFactors/DFactors.py

*** Keywords ***
Op Insure Relation Part
    [Arguments]    ${TypeCode}    ${name1}    ${RealtionType}    ${Businesscode}
    #滚动
    Scroll Element In View    ${InsuredOwnerCode}
    #被保险人类型 个人
    Select From List By Value    ${InsuredOwnerCode}    ${TypeCode}
    ${name}=    PersonName
    run keyword if    '${TypeCode}' == '${VTypeCode}[0]'    input text    ${InsuredName}    ${name}
    ...    ELSE    input text    ${InsuredName}    ${name1}
    #证件类型
    run keyword if    '${TypeCode}' == '${VTypeCode}[0]'    Select From List By Value    ${Insuredpresonal}    ${RealtionType}
    ...    ELSE    Select From List By Value    ${LInsuredGroup}    ${RealtionType}
    #证件值
    ${value}=    GetDataOfIdentifyType    ${RealtionType}
    input text    ${Insuredidnum}    ${value}
    #证件有效期
    ${DexprityDate}=    Dexprity
    input text    ${InsuredriskIdentifyExpiry}    ${DexprityDate}
    #电话
    ${phone}=    Phone
    input text    ${InsuredPhone}    ${phone}
    #Email
    ${Email}=    Email
    input text    ${Insuredemail}    ${Email}
    #邮编
    ${postid}=    Postcode
    input text    ${InsuredpostCode}    ${postid}
    #职业
    run keyword if    '${TypeCode}' == '${VTypeCode}[0]'    Select From List By Value    ${InsuredOccupName}    ${Businesscode}
    ...    ELSE    Select From List By Value    ${LInsureBusCode}    ${Businesscode}
    #地址
    Select From List By Value    ${InsuredProvinceCode}    140000
    Select From List By Value    ${InsuredCityCode}    140100
    Select From List By Value    ${InsuredDistrictCode}    140105
